<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="/WEB-INF/jsp/common/common.jsp" />
<script type="text/javascript">
	$(function(){
		 	$("#emp").hide();
 	});
	function myAdd() {
		$("#emp").show();
	}
	function makeTrue() {
		var url = "${path}/ix/word/add.htm";
		$("#form1").attr("action", url);
		$("#form1").submit();
	}
	function makeCancel(){
		$("#emp").hide();
		$("input[name='name']").val("");
		$("input[name='word_id']").val("");
	}
	function goEdit(word_id,name) {
		$("input[name='word_id']").val(word_id);
		$("input[name='name']").val(name);
		$("#emp").show();
	}
	function goDel(word_id) {
		$("input[name='word_id']").val(word_id);

		var url = "${path}/ix/word/del.htm";
		$("#form1").attr("action", url);
		$("#form1").submit();
	}
</script>
</head>
<body>
	<jsp:include page="/WEB-INF/jsp_lib/tip.jsp" />
	<div>
		<form action="${path}/ix/word/list.htm" id="form1" method="post">
			<input type="hidden" name="role_id" />
			<h2>
				<div>文种词管理</div>
			</h2>
			<table width="100%" class="listlindex">
				<tr>
					<th>名称</th>
					<th>创建时间</th>
					<th>操作</th>
				</tr>
				<c:if test="${fn:length(list)==0}">
					<tr>
						<td colspan="3"><div class="tip_div">暂无记录.</div></td>
					</tr>
				</c:if>
				<c:forEach items="${list}" var="v">
					<tr>
						<td>${v.name}</td>
						<td><fmt:formatDate value="${v.created}" pattern="yyyy-MM-dd HH:mm" /></td>
						<td><a href="javascript:goEdit('${v._id}','${v.name}');">【修改】</a> <a
							href="javascript:goDel('${v._id}');">【删除】</a></td>
					</tr>
				</c:forEach>
			</table>
			<div id="response"></div>
			<div class="options">
				<p>
					<a href="javascript:myAdd();">【添加】</a>
				</p>
				<div class="clear"></div>
			</div>
			<div id="emp" style="height: 400px;position:fixed;left:36%;top:30%;" hidden="true">
				<div class="query">
					<h2>
						<div>文种词</div>
					</h2>
					<table width="100%" class="listlindex">
						<input name="word_id" type="hidden" value="" type="text" />
						<tr>
							<th align="right">名称：</th>
							<td align="left" colspan="3">
								<input name="name" value="" type="text" />
							</td>
						</tr>
					</table>	
					<div>&nbsp;</div>
					<a href="javascript:makeTrue();">【确定】</a>
					<a href="javascript:makeCancel();">【取消】</a>
				</div>
			</div>	
		</form>

	</div>
</body>
</html>